#pragma once

#include <vector>
#include "AbstractGraph.h"

namespace {
	class ListGraph : public Graph{
	private:
		std::vector<std::vector<int> > listOfAdjacents_;
	public:
		ListGraph(int vertexNum, const std::vector<Edge>& edgesList){
			setVertexNum(vertexNum);
			
			listOfAdjacents_.resize(getVertexNum());
			for (size_t edgesNum = 0; edgesNum < edgesList.size(); ++edgesNum){
				int fromVertex = edgesList[edgesNum].fromVertex;
				int toVertex = edgesList[edgesNum].toVertex;
				listOfAdjacents_[fromVertex].push_back(toVertex);
			}
		}
		const std::vector<int> getAdjacentList(int inputVertex)const {
			return listOfAdjacents_[inputVertex];
		}
		
	};
}
